
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 2
 * @Author : WangRuoyu 
 * @Date : 2023/5/15 10:58
 */

#include "iostream"
#include "algorithm"

using namespace std;

struct ball {
    int id;
    int x;
    int v;
};

bool cmpid(ball a, ball b) {
    return a.id < b.id;
}

bool cmpx(ball a, ball b) {
    return a.x < b.x;
}

int main() {
    int n, l, t;
    cin >> n >> l >> t;
    ball balls[n];

    for (int i = 0; i < n; ++i) {
        balls[i].id = i;
        cin >> balls[i].x;
        balls[i].v = 1;
    }

    sort(balls, balls + n, cmpx);

    for (int i = 0; i < t; ++i) {
        for (int j = 0; j < n; ++j) {
            balls[j].x += balls[j].v;
            if (balls[j].x == 0) {
                balls[j].v = 1;
            }
            if (balls[j].x == l) {
                balls[j].v = -1;
            }
        }
        for (int j = 0; j < n - 1; ++j) {
            if (balls[j].x == balls[j + 1].x) {
                balls[j].v = -1;
                balls[j + 1].v = 1;
            }
        }
    }

    sort(balls, balls + n, cmpid);

    for (int i = 0; i < n; ++i) {
        cout << balls[i].x << " ";
    }
    return 0;
}